<template>
  <div class="customer-service">
    <div class="title-box">
      <div class="title-name">客服支持</div>
    </div>
    <div  v-if="serviceList && serviceList.length === 0" class="no-data">
      <img src="https://mt.heng-tai.com.cn/m-perfeval-pc/img/pc-other_zwsj_icon.4c654fe.png" alt="">
      <div>暂无数据</div>
    </div>
    <div v-else class="content" >
      <div v-for="l in serviceList" class="content-item">
        <div class="news-name">{{l.name}}</div>
        <span class="look"  @click="lookDetail(l)">查看</span>
      </div>
    </div>
  </div>
</template>

<script>
import titleBar from '@/moduleComponents/newWorkbench/titleBar';
import ellipsisForText from '@/moduleComponents/newWorkbench/ellipsisForText';
import { AcOverallStructureorkbenchTable } from '@const/api_authCenter.js';
export default {
  name: 'customerService',
  components: {
    titleBar,
    ellipsisForText
  },
  data() {
    return {
      serviceList: []
    };
  },
  created() {
    this.getServiceList();
  },
  methods: {
    getServiceList() {
      this.$axios({
        url: AcOverallStructureorkbenchTable,
        method: 'post'
      })
        .then(res => {
          this.serviceList = res.data.payload || [];
        })
        .catch(err => {
          console.log(err);
        });
    },
    // 查看
    lookDetail({ value }) {
      this.$router.push({
        path: '/newWorkbench/customerSupportList',
        query: {
          tabKey: value
        }
      });
    }
  }
};
</script>

<style scoped lang="less">
.customer-service {
  .content {
    padding-top: 10px;
    box-sizing: border-box;
    height: calc(100% - 10px);
    overflow: auto;
  }
  .title-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 48px;
    background-image: linear-gradient(to right, #e6edff, #fff);
    padding: 0 15px;
    box-sizing: border-box;
  }
  .title-name {
    font-size: 15px;
    color: #333333;
  }
  .news-name {
    width: 167px;
    height: 34px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .look {
    width: 28px;
    height: 34px;
    font-size: 14px;
    color: #4d84ff;
    cursor: pointer;
  }
  .content-item {
    line-height: 34px;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    box-sizing: border-box;
  }
  .no-data {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 14px;
    color: #999999;
    margin-top: -15px;
    img {
      width: 172px;
      height: 100px;
      margin-bottom: 17px;
    }
  }
}
</style>
